package com.tju.system.controller;

import com.tju.system.pojo.User;
import com.tju.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Objects;

/**
 * @author 11873
 */
@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;

//    @RequestMapping(value = "/register",method = RequestMethod.POST)
//    public String register(HttpServletRequest request, @RequestParam("username")String username,
//                         @RequestParam("name")String name, @RequestParam("password")String password) throws UnsupportedEncodingException {
//        request.setCharacterEncoding("UTF-8");
//        User user = new User();
//        user.setName(name);
//        user.setPassword(password);
//        user.setUsername(username);
//        String Nowtime = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
//        java.sql.Date mysqldate = java.sql.Date.valueOf(Nowtime);
//        user.setDate(mysqldate);
//        userService.addUser(user);
//        return "注册成功";
//
//    }

    
        
       
    }
